{% extends "misago/admin/generic/form.html" %}
{% load i18n misago_admin_form %}


{% block title %}
{% blocktrans trimmed with role=target %}
  {{ role }}: Category permissions
{% endblocktrans %} | {{ block.super }}
{% endblock title %}


{% block page-header %}
{{ block.super }}
<small>
  {{ target }}
</small>
{% endblock page-header %}


{% block page-actions %}
<div class="col-auto page-action">
  <a href="{% url 'misago:admin:permissions:edit' pk=target.pk %}" class="btn btn-primary btn-sm">
    <span class="fa fa-edit"></span>
    {% trans "Edit role" %}
  </a>
</div>
{% endblock %}


{% block form-header %}
{% trans "Change permissions" %}
{% endblock form-header %}


{% block form-body %}
  {% for form in forms %}
    <div class="form-group row">
      <label for="{{ form.category_role.id_for_label }}" class="col-sm-4 col-form-label">
        {% for i in form.category.level_range %}
          &nbsp;&nbsp;&nbsp;&nbsp;
        {% endfor %}
        {{ form.category }}:
      </label>
      <div class="col-sm-8">
        {% form_input form.role %}
      </div>
    </div>
  {% endfor %}
{% endblock form-body %}


{% block javascripts %}
<script type="text/javascript">
  window.misago.initConfirmation(
    "[data-cancel-confirmation]",
    "{% trans 'Are you sure you want to abandon changes?' %}"
  )
</script>
{% endblock %}
